#region Usings
using BK.BlusinessLogic;
using BK.Model;
using BK.Repositories.Abstract;
using BK.Repositories.Factory;

using Lib.Utils.WorkerUtils;
#endregion

namespace BK.Import
{
    [WorkerItem]
    public class BestExpenseFilesWorkerItem : BaseExpenseFilesWorkerItem<BestExpense, BestExpensesFile, BestExpensesFilesBl, IBestExpensesFilesRepository>
    {
        #region C'tors
        public BestExpenseFilesWorkerItem() 
            : base
            (
                RepositoryFactory.Get<IUsersRepository>(),
                RepositoryFactory.Get<IBestExpensesFilesRepository>()
            )
        {
        }
        #endregion

        #region Instance Methods
        protected override void DoBeforeDoExecute()
        {
            BestExpense.ResetMappedProperties();
        }

        protected override BestExpensesFilesBl DoCreateExpensesFilesBl(IBestExpensesFilesRepository expensesFileRepository)
        {
            return new BestExpensesFilesBl(expensesFileRepository);
        }

        protected override void DoTieFileToUser(User user, BestExpensesFile expensesFile)
        {
            UsersBl.Tie(user, expensesFile);
        }
        #endregion
    }
}